package com.xx.controller;

import com.xx.comm.R;
import com.xx.dto.LoginDTO;
import com.xx.service.IUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author myx
 * @since 2024-12-23
 */
@RestController
@RequestMapping("/user")
@Tag(name = "UserController",description = "用户前端控制器")
public class UserController {
    @Autowired
    IUserService iUserService;
    @PostMapping("/login")
    @Operation(description = "登录接口")
    public R login(@RequestBody LoginDTO loginDTO){
        return R.success(iUserService.login(loginDTO));
    }

    @GetMapping
    @Operation(description = "获取用户信息")
    public R getUserInfo(){
        return R.success();
    }

}
